package com.orm.analysis.service.impl;

import com.orm.analysis.dao.impl.CreditCardDAO;
import com.orm.analysis.model.CreditCard;
import com.orm.analysis.service.GenericService;
import org.apache.log4j.Logger;

import java.io.IOException;
import java.text.ParseException;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: saman
 * Date: 10/12/13
 * Time: 7:29 AM
 * To change this template use File | Settings | File Templates.
 */
public class CreditCardService implements GenericService<CreditCard> {


    private static Logger log = Logger.getLogger(CreditCardService.class);


    private CreditCardDAO dao;


    public CreditCardDAO getDao() {
        return dao;
    }

    public void setDao(CreditCardDAO dao) {
        this.dao = dao;
    }

    public CreditCard create(CreditCard entity) {
        dao.save(entity);
                return entity;
            }


    public void delete(Object id) {

        dao.delete(id);
    }
    public CreditCard update(CreditCard entity) {
        dao.update(entity);
            return entity;
        }

    public List<CreditCard> list(int page, int size) {
        return dao.list(page,size);
    }

    public List<CreditCard> listByFields(String... fieldsNamesValues) {
        StringBuffer queryString= new StringBuffer("select a from Payment a ");
                  return dao.listByFields(queryString,fieldsNamesValues);
          }
    public List<CreditCard> findAllWithDepth(String... fetchRelations) {
                      return dao.findAllWithDepth(CreditCard.class, fetchRelations);
                  }

                  public CreditCard findWithDepth(String pkFieldName, Object id, String... fetchRelations) {
                      return dao.findWithDepth(CreditCard.class,pkFieldName,id,fetchRelations);
                  }

    public  int updateExecuteUpdateByQuery(String query){
        return dao.updateExecuteUpdateByQuery(query);
    }
    public CreditCard getById(CreditCard entity) {
        return dao.getById(entity.getPaymentId());
    }

    public CreditCard getById(Integer id) {
        return dao.getById(id);
            }


    public void executeImproter() throws ParseException, IOException {

    }

    public List<Integer> getIdList() {
        return null;  //To change body of implemented methods use File | Settings | File Templates.
    }

    public void processTaskExecutor() {
        //To change body of implemented methods use File | Settings | File Templates.
    }

    public List<CreditCard> getByIdList(Integer[] entityIdList) {
        return null;  //To change body of implemented methods use File | Settings | File Templates.
    }
}
